<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="/WEB-INF/tags/functions.tld" %>
<%@ taglib prefix="t" uri="/WEB-INF/tags/tags.tld" %>

<c:if test="${registeredClasses == null or empty registeredClasses}">
	<b>Chưa đăng ký lớp nào</b>
</c:if>
<c:if test="${registeredClasses != null and !empty registeredClasses}">
	<br />
	<h3 style="margin-left: 5%">Danh sách lớp đã đăng ký</h3>
	<hr size="1" align="center" width="90%" />
	<form action="/student/cancelRegisteredClasses.html?cId=${param.cId}&sId=${param.sId}&p=${param.p == null ? 1 : param.p}" method="post">
		<table>
			<thead>
				<tr>
					<td class="th" style="width: 1em;"><input type="checkbox" name="checkAll" id="checkAll" /></td>
					<th class="th">STT</th>
					<th class="th">Mã lớp</th>	
					<th class="th">Tên lớp</th>
					<th class="th">Học phần</th>
					<th class="th">Xóa</th>
				</tr>	
			</thead>
			<tbody>
			<c:forEach items="${registeredClasses}" var="c" varStatus="status">
				<tr>
					<td class="td" style="width: 1em;"><input type="checkbox" name="checkItem" value="${f:keyToString(c.classKey)}" /></td>
					<td class="td"><c:out value="${status.count}" escapeXml="true" /></td>
					<td class="td"><c:out value="${c.classId}" escapeXml="true" /></td>
					<td class="td"><c:out value="${c.className}" escapeXml="true" /></td>
					<td class="td"><c:out value="${c.subject.subjectId}" escapeXml="true" /></td>
					<td class="td"><a href="/student/cancelRegisteredClass/${f:keyToString(c.classKey)}.html?cId=${param.cId}&sId=${param.sId}&p=${param.p == null ? 1 : param.p}" class="deleteLink"><img src="/images/delete.png" width="15" height="15" /></a></td>
				</tr>
			</c:forEach>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="6">
						<input type="submit" value="Xóa lớp" id="deleteGroup" disabled="disabled" style="margin-top: 0.6em;" />
					</td>
				</tr>
			</tfoot>
		</table>
	</form>
</c:if>